import { request } from '@/common/utils/request'

// 获取废物名录详情
export const wasteDirectoryDetail = (data) => {
	return request({
		url: '/biz/wasteDirectory/detail',
		method: 'GET',
		data,
	})
}
// 获取包装方式详情
export const bizPackageWaySelectList = (data) => {
	return request({
		url: '/biz/packageWay/selectList',
		method: 'GET',
		data,
	})
}

// 废物的 包装方式下啦
export const packageWaySelectorApi = (data) => {
	return request({
		url: '/biz/wasteDirectory/packageWaySelector',
		method: 'GET',
		data,
	})
}
// 设施设备选择器
export const bizFacilitySelector =(data)=>  {
  return request({
		url: '/biz/facility/selector',
		method: 'GET',
		data,
	})
}
// 获取废物名录类别下拉列表
export const bizDirectoryCategorySelectList = (data) => {
	return request({
		url: '/biz/directoryCategory/selectList',
		method: 'GET',
		data,
	})
}
// 名录列表
export const wasteDirectoryPageApi = (data) => {
	return request({
		url: '/biz/wasteDirectory/touchPage',
		method: 'GET',
		data,
	})
}
// 名录列表
export const wasteDirectoryListApi = (data) => {
	return request({
		url: '/biz/wasteDirectory/list',
		method: 'GET',
		data,
	})
}
// 产生单位
export const produceUnitSelectorApi = (data) => {
	return request({
		url: '/biz/produceUnit/produceUnitSelector',
		method: 'GET',
		data,
	})
}
// 产生部门
export const produceDeptSelectorApi = (data) => {
	return request({
		url: '/biz/produceUnit/produceDeptSelector',
		method: 'GET',
		data,
	})
}
// 获取废物名录 类别下的 下拉
export const directorySelectorApi = (data) => {
	return request({
		url: '/biz/wasteDirectory/directorySelector',
		method: 'GET',
		data,
	})
}
// 提交废物产生记录表单 edit为true时为编辑，默认为新增
export const bizWasteRecordsSubmitForm = (data, edit = false) => {
	return request({
		url: '/biz/wasteRecords/' + (edit ? 'edit' : 'add'),
		method: 'POST',
		data,
	})
}

// 去向单位选择器
export const disposeUnitSelector = (data) => {
	return request({
		url: '/biz/outStorage/disposeUnitSelector',
		method: 'GET',
		data,
	})
}
// 处置利用方式

export const processWaySelector = (data) => {
	return request({
		url: '/biz/outStorage/processWaySelector',
		method: 'GET',
		data,
	})
}
// 转移单位
export const transferUnitSelector = (data) => {
	return request({
		url: '/biz/outStorage/transferUnitSelector',
		method: 'GET',
		data,
	})
}
// 接收人 车辆
export const receiveInfoSelector = (data) => {
	return request({
		url: '/biz/outStorage/receiveInfoSelector',
		method: 'GET',
		data,
	})
}
// 贮存站场选择器
export const storageFacilitySelector = (data) => {
	return request({
		url: '/biz/storageFacility/storageFacilitySelector',
		method: 'GET',
		data,
	})
}

// 名录列表 ???
export const wasteDirectoryListApi2 = (data) => {
	return request({
		url: '/param/config/collectList',
		method: 'GET',
		data,
	})
}

// 全部名录级别  ????
export const selectWasteLevelApi = (data) => {
	return request({
		url: '/param/config/selectWasteType1',
		method: 'GET',
		data,
	})
}

// 常用名录级别
export const selectWasteLevelApi2 = (data) => {
	return request({
		url: '/param/config/selectCollect',
		method: 'GET',
		data,
	})
}

// 废物产生表单信息 ??
export const wasteInfoApi = (data) => {
	return request({
		url: '/biz/wasteDirectory/queryByCode',
		method: 'GET',
		data,
	})
}

// 包装方式列表
export const packageListApi = (data) => {
	return request({
		url: '/param/config/packageList',
		method: 'GET',
		data,
	})
}

// 去向单位列表
export const destinationUnitListApi = (data) => {
	return request({
		url: '/unit/getUnitList',
		method: 'GET',
		data,
	})
}

// 常序产生登记
export const addRecordApi = (data) => {
	return request({
		url: '/record/addOrUpdateRecord',
		method: 'POST',
		data,
	})
}

// 集约、直派产生登记
export const addRecord2Api = (data) => {
	return request({
		url: '/record/addOrUpdateSource',
		method: 'POST',
		data,
	})
}

// 入库扫码、 。
export const inStorageInfoApi = (data) => {
	return request({
		url: '/biz/inStorage/scanQrcode',
		method: 'GET',
		data,
	})
}

// 入库 。
export const inStorageAddApi = (data) => {
	return request({
		url: '/biz/inStorage/add',
		method: 'POST',
		data,
	})
}
// 出库扫码
export const outStorageInfoApi = (data) => {
	return request({
		url: '/biz/outStorage/scanQrcode',
		method: 'GET',
		data,
	})
}
// 出库 。
export const outStorageAddApi = (data) => {
	return request({
		url: '/biz/outStorage/add',
		method: 'POST',
		data,
	})
}

// 获取废物处置待登记分页 .
export const bizDisposalWaitPageApi = (data) => {
	return request({
		url: '/biz/bizDisposal/waitPage',
		method: 'GET',
		data,
	})
}
// 获取废物处置登记信息
export const disposalInfo = (data) => {
	return request({
		url: '/biz/bizDisposal/disposalInfo',
		method: 'GET',
		data,
	})
}

// 提交废物处置登记表单 。
export const bizDisposalAddOrUpdate = (data) => {
	return request({
		url: '/biz/bizDisposal/addOrUpdate',
		method: 'POST',
		data,
	})
}




// 添加入库、出库记录
export const addStorageApi = (data) => {
	return request({
		url: '/record/addOrUpdateRecordList',
		method: 'POST',
		data,
	})
}

// 合并入库记录
export const mergeRecordList = (data) => {
	return request({
		url: '/record/addRecordList',
		method: 'POST',
		data,
	})
}

// 检查入库是否有偏差
export const checkInDeviationApi = (data) => {
	return request({
		url: '/record/checkInDeviation',
		method: 'POST',
		data,
	})
}

// 集约未处理记录
// export const intensivePendingListApi = (data) => {
// 	return request({
// 		url: '/record/intensiveDealList',
// 		method: 'GET',
// 		data,
// 	})
// }
// export const intensivePendingListApi = (data) => {
//     return request({
//         url: '/record/recordList1',
//         method: 'GET',
//         data
//     })
// }

//获取处置联系人
export const getLinksApi = (data) => {
	return request({
		url: '/getLinks',
		method: 'GET',
		data,
	})
}

// 去向单位列表
export const getUnitListApi = (data) => {
	return request({
		url: '/unit/getUnitList',
		method: 'GET',
		data,
	})
}

// 根据地磅id查询自动地磅信息
export const getReceivedNameIdApi = (data) => {
	return request({
		url: '/NetData/getReceivedNameId',
		method: 'GET',
		data,
	})
}

// 根据条件查询手动匹配地磅信息
export const getReceivedNameListApi = (data) => {
	return request({
		url: '/NetData/getReceivedNameList',
		method: 'GET',
		data,
	})
}

// 集约处置确认查询
export const infoIntensiveApi = (data) => {
	return request({
		url: '/record/recordsOutInfo',
		method: 'POST',
		data,
	})
}

// 集约处置提交
export function addIntensiveApi(data) {
	return request({
		url: '/record/updateListWeightType',
		method: 'post',
		data,
	})
}

// 处置确认提交1
export const updateDisposeApi1 = (data) => {
	return request({
		url: '/record/updateListWeight',
		method: 'POST',
		data,
	})
}

// 处置确认提交2
export const updateDisposeApi2 = (data) => {
	return request({
		url: '/record/updateListW',
		method: 'GET',
		data,
	})
}

// 处置确认提交3
export const updateDisposeApi3 = (data) => {
	return request({
		url: '/record/updateRecordList',
		method: 'POST',
		data,
	})
}

// 数据同步
export const addNetDataApi = (data) => {
	return request({
		url: '/NetData/addNetData',
		method: 'GET',
		data,
	})
}


// 集约出场扫码.
export const intensiveOutScan = (data) => {
	return request({
		url: '/biz/wasteRecords/appearScanQrcode',
		method: 'GET',
		data,
	})
}
// 集约出场.
export const intensiveOut = (data) => {
	return request({
		url: '/biz/wasteRecords/intensiveAppear',
		method: 'POST',
		data,
	})
}
